package com.order.openfeign.fallback;

import com.example.product.Product;
import com.order.openfeign.ProductOpenfeignClient;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

@Component
public class ProductFeignFallback implements ProductOpenfeignClient {

    @Override
    public Product getProductById(Long productId) {
        System.out.println("兜底返回：");
        Product product = new Product();
        product.setProductId(productId);
        product.setProductName("位置商品-" + productId);
        product.setNum(0);
        product.setPrice(new BigDecimal("99"));
        return product;
    }
}
